/* Layout */
import Layout from '../views/layout/Layout';

const _import = require(`./_import_${process.env.NODE_ENV}`);

const agencyRoutes = [
  {
    path: '/agency',
    component: Layout,
    // redirect: '/permission/index',
    // meta: { roles: [] }, // you can set roles in root nav
    redirect: 'noredirect',
    name: 'agency',
    meta: {
      title: '代理管理',
      icon: 'peoples',
      roles: [],
    },
    children: [
      {
        path: 'agency-list',
        name: 'agency-list',
        component: _import('agency/list/index'),
        meta: {
          noCache: true,
          title: '代理列表',
          roles: [
            'batch-lock'/* 批量锁定/解锁 */, 'lock'/* 单个锁定/解锁 */, 'edit-btn'/* 编辑资料 */, 'detail-btn'/* 会员账户 */,
            'agency'/* 所属代理 */, 'backup'/* 备注 */, 'create-agent'/* 创建代理 */, 'edit-commission'/* 编辑返佣 */,
            'credit'/* 上分设置 */, 'credit-settlement'/* 上分清算 */, 'edit-member-info'/* 更改会员资料 */, 'reset-name-bank'/* 重置姓名/银行卡 */,
            'member-info'/* 会员信息 */, 'trade-info'/* 交易信息 */, 'login-log'/* 登陆日志 */, 'arbitrage-query'/* 套利查询 */,
            'bank-info'/* 银行信息 */, 'operation-log'/* 操作记录 */, 'address'/* 我的地址 */, 'set-record'/* 上分设置记录 */, 'clear-record'/* 上分清算记录 */,
            'credit-agent'/* 代理上分记录 */, 'agent-record'/* 代理上分设置 */, 'export-list'/* 导出 */, 'export-set-record'/* 导出上分设置记录 */,
            'export-clear-record'/* 导出上分清算记录 */, 'export-agent-record'/* 导出代理上分记录 */, 'export-trade-info'/* 导出代理交易信息 */,
            'phone-show-partial'/* 手机号部分显示 */, 'phone-show-all'/* 手机号全部显示 */, 'email-show-partial'/* 邮箱部分显示 */,
            'email-show-all'/* 邮箱全部显示 */, 'edit-commission-chain', /* 编辑佣金链 */'sync-agency-user', /* 同步 */'modify-level', /* 修改层级 */'batch-modify-level', /* 批量修改层级 */
            'member-record', /* 会员上分记录 */, 'export-member-record', /* 会员上分记录导出 */,
          ],
        },
      },
      {
        path: 'agency-tree',
        name: 'agency-tree',
        component: _import('agency/agencyTree/index'),
        meta: {
          title: '代理结构图',
          roles: [], // or you can only set roles in sub nav
        },
      },
      {
        path: 'detail/:id',
        name: '代理信息',
        component: _import('agency/detail/index'),
        hidden: true,
        meta: {
          title: '代理信息',
          icon: 'people',
          roles: [], // or you can only set roles in sub nav
        },
      },
      {
        path: 'agency-audit',
        name: 'agency-audit',
        component: _import('agency/audit/index'),
        meta: {
          title: '代理审核',
          roles: ['first-audit', 'second-audit', 'phone-show-partial'/* 手机号部分显示 */, 'phone-show-all'/* 手机号全部显示 */,
            'email-show-partial'/* 邮箱部分显示 */, 'email-show-all'], // or you can only set roles in sub nav
          // noCache:true
        },
      },
      {
        path: 'agency-domain',
        name: 'agency-domain',
        component: _import('agency/domain/index'),
        meta: {
          title: '代理域名',
          roles: ['check', 'update'], // or you can only set roles in sub nav
        },
      },
      {
        path: 'agency-operate-audit',
        name: 'agency-operate-audit',
        component: _import('agency/updateAudit/index'),
        meta: {
          title: '操作审核',
          roles: ['first-audit','second-audit','phone-show-partial'/*手机号部分显示*/,'phone-show-all'/*手机号全部显示*/,
            'email-show-partial'/*邮箱部分显示*/,'email-show-all'/*邮箱全部显示*/, 'is-show-export'/*导出功能显示*/] // or you can only set roles in sub nav
        }
      },
      {
        path: 'agency-lock-logs',
        name: 'agency-lock-logs',
        component: _import('agency/lockLogs/lockLogs'),
        meta: {
          title: '异常记录',
          roles: [], // or you can only set roles in sub nav
        },
      },
      {
        path: 'agency-summary',
        name: 'agency-summary',
        component: _import('agency/summaryPoints/index'),
        meta: {
          title: '代充汇总记录',
          roles: [], // or you can only set roles in sub nav
        },
      },
      {
        path: 'agency-phone-email-record',
        name: 'agency-phone-email-record',
        component: _import('agency/phoneAndEmailRecord/index'),
        meta: {
          title: '手机邮箱记录',
          roles: ['phone-show-partial'/* 手机号部分显示 */, 'phone-show-all'/* 手机号全部显示 */, 'email-show-partial'/* 邮箱部分显示 */,
            'email-show-all'], // or you can only set roles in sub nav
        },
      },
    ],
  },
];

export default agencyRoutes;
